#ifndef GDI32_H
#define GDI32_H

#include "minwin.h"

#define PFD_TYPE_RGBA 0
#define PFD_TYPE_COLORINDEX 1
#define PFD_MAIN_PLANE 0
#define PFD_OVERLAY_PLANE 1
#define PFD_UNDERLAY_PLANE (-1)
#define PFD_DOUBLEBUFFER                 0x1
#define PFD_STEREO                       0x2
#define PFD_DRAW_TO_WINDOW               0x4
#define PFD_DRAW_TO_BITMAP               0x8
#define PFD_SUPPORT_GDI                 0x10
#define PFD_SUPPORT_OPENGL              0x20
#define PFD_GENERIC_FORMAT              0x40
#define PFD_NEED_PALETTE                0x80
#define PFD_NEED_SYSTEM_PALETTE        0x100
#define PFD_SWAP_EXCHANGE              0x200
#define PFD_SWAP_COPY                  0x400
#define PFD_SWAP_LAYER_BUFFERS         0x800
#define PFD_GENERIC_ACCELERATED       0x1000
#define PFD_SUPPORT_DIRECTDRAW        0x2000
#define PFD_DIRECT3D_ACCELERATED      0x4000
#define PFD_SUPPORT_COMPOSITION       0x8000
#define PFD_DEPTH_DONTCARE        0x20000000
#define PFD_DOUBLEBUFFER_DONTCARE 0x40000000
#define PFD_STEREO_DONTCARE       0x80000000

#define WHITE_BRUSH 0
#define LTGRAY_BRUSH 1
#define GRAY_BRUSH 2
#define DKGRAY_BRUSH 3
#define BLACK_BRUSH 4
#define NULL_BRUSH 5
#define HOLLOW_BRUSH NULL_BRUSH
#define WHITE_PEN 6
#define BLACK_PEN 7
#define NULL_PEN 8
#define DC_PEN 19

typedef struct tagPIXELFORMATDESCRIPTOR {
	WORD  nSize;
	WORD  nVersion;
	DWORD dwFlags;
	BYTE  iPixelType;
	BYTE  cColorBits;
	BYTE  cRedBits;
	BYTE  cRedShift;
	BYTE  cGreenBits;
	BYTE  cGreenShift;
	BYTE  cBlueBits;
	BYTE  cBlueShift;
	BYTE  cAlphaBits;
	BYTE  cAlphaShift;
	BYTE  cAccumBits;
	BYTE  cAccumRedBits;
	BYTE  cAccumGreenBits;
	BYTE  cAccumBlueBits;
	BYTE  cAccumAlphaBits;
	BYTE  cDepthBits;
	BYTE  cStencilBits;
	BYTE  cAuxBuffers;
	BYTE  iLayerType;
	BYTE  bReserved;
	DWORD dwLayerMask;
	DWORD dwVisibleMask;
	DWORD dwDamageMask;
} PIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;

typedef struct tag_LAYERPLANEDESCRIPTOR {
	WORD     nSize;
	WORD     nVersion;
	DWORD    dwFlags;
	BYTE     iPixelType;
	BYTE     cColorBits;
	BYTE     cRedBits;
	BYTE     cRedShift;
	BYTE     cGreenBits;
	BYTE     cGreenShift;
	BYTE     cBlueBits;
	BYTE     cBlueShift;
	BYTE     cAlphaBits;
	BYTE     cAlphaShift;
	BYTE     cAccumBits;
	BYTE     cAccumRedBits;
	BYTE     cAccumGreenBits;
	BYTE     cAccumBlueBits;
	BYTE     cAccumAlphaBits;
	BYTE     cDepthBits;
	BYTE     cStencilBits;
	BYTE     cAuxBuffers;
	BYTE     iLayerType;
	BYTE     bReserved;
	COLORREF crTransparent;
} LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR;

typedef struct _GLYPHMETRICSFLOAT {
	FLOAT      gmfBlackBoxX;
	FLOAT      gmfBlackBoxY;
	POINTFLOAT gmfptGlyphOrigin;
	FLOAT      gmfCellIncX;
	FLOAT      gmfCellIncY;
} GLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;

HGDIOBJ WINAPI GetStockObject(int fnObject);

int WINAPI ChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR *ppfd);

BOOL WINAPI SetPixelFormat(HDC hdc, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd);

BOOL WINAPI SwapBuffers(HDC hdc);

#endif
